package cn.iocoder.yudao.module.call.dal.mysql.speech;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.call.dal.dataobject.speech.SpeechDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.call.controller.admin.speech.vo.*;

/**
 * 话术 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface SpeechMapper extends BaseMapperX<SpeechDO> {

    default PageResult<SpeechDO> selectPage(SpeechPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SpeechDO>()
                .eqIfPresent(SpeechDO::getTitle, reqVO.getTitle())
                .eqIfPresent(SpeechDO::getContent, reqVO.getContent())
                .betweenIfPresent(SpeechDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SpeechDO::getId));
    }

}